﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Net;
using System.Net.Sockets;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using System.Drawing.Drawing2D;
using System.Net.NetworkInformation;
using ESS280Ah_TestTool;
using System.Xml;
using System.Text.RegularExpressions;
using OmronFinsUDP;

namespace FinsDebuger
{
    public partial class Form_Main : Form
    {
        public Form_Main()//窗口初始化
        {
            InitializeComponent();
        }
        EtherNetPLCUDP ENT_01 = new EtherNetPLCUDP();
        private void button_Link_Click(object sender, EventArgs e)
        {
            short re=ENT_01.Link(textBox_IP.Text, short.Parse(textBox_PORT.Text));
            if (re==0)
            {
                button_Link.Text = "断开";
            }
            else
            {
                button_Link.Text = "失败";
            };
        }

        private void button_ReadWords_Click(object sender, EventArgs e)
        {
           // ENT_01.ReadWords(ENT_01.str2PlcType(textBox_Area.Text),)
        }

        private void Form_Main_Load(object sender, EventArgs e)
        {

        }

        private void button3_Click(object sender, EventArgs e)
        {
            short reData;
            ENT_01.GetBitState(comboBox__Area1.Text, txtBitAdd.Text, out reData);
            text_bitState.Text = reData.ToString();
        }
    }


}
